package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	// http包
	client := http.Client{}
	res, _ := client.Get("http://localhost:8080/add?a=10&b=6")

	ct := res.Header.Get("Content-Type")
	date := res.Header.Get("Date")

	fmt.Println("ct: ", ct)
	fmt.Println("date: ", date)

	url := res.Request.URL
	code := res.StatusCode
	status := res.Status

	fmt.Println("url: ", url)
	fmt.Println("code: ", code)
	fmt.Println("status: ", status)

	body := res.Body
	readBodyStr, _ := ioutil.ReadAll(body)
	fmt.Println("readBodyStr: ", string(readBodyStr))
}
